const Url = "https://service-qfzf8mg2-1310248965.hk.apigw.tencentcs.com/v1/chat/completions"//这是我要请求的数据接口的公共部分
const ChatGPT = (options) =>{
  return new Promise((resolve,reject) => {
    wx.request({
      url: Url,
      method:'post',
      data:{
        messages:JSON.parse(options.parm),
        model: 'gpt-3.5-turbo',
        max_tokens: 1200,
        frequency_penalty: 0,
        presence_penalty:0.6,
        stream: false,
        temperature:0.5,
        top_p:1,
      },
      header: options.header || {
        'Authorization': `Bearer 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`,
        'Content-Type': 'application/json'
      },
      success:resolve,
      fail:reject
    })
  })
}
export default ChatGPT
